package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution1254 {
    public int closedIsland(int[][] grid) {
        return GraphUtils.closedIsland(grid);
    }
}

public class leetcode1254 {
    public static void main(String[] args) {
        Solution1254 solution1254 = new Solution1254();
        int[][] grid = {
                {1, 1, 1, 1, 1, 1, 1, 0},
                {1, 0, 0, 0, 0, 1, 1, 0},
                {1, 0, 1, 0, 1, 1, 1, 0},
                {1, 0, 0, 0, 0, 1, 0, 1},
                {1, 1, 1, 1, 1, 1, 1, 0}
        };
        System.out.println(solution1254.closedIsland(grid));

        int[][] grid1 = {
                {0, 0, 1, 0, 0},
                {0, 1, 0, 1, 0},
                {0, 1, 1, 1, 0}
        };
        System.out.println(solution1254.closedIsland(grid1));

        int[][] grid2 = {
                {1, 1, 1, 1, 1, 1, 1},
                {1, 0, 0, 0, 0, 0, 1},
                {1, 0, 1, 1, 1, 0, 1},
                {1, 0, 1, 0, 1, 0, 1},
                {1, 0, 1, 1, 1, 0, 1},
                {1, 0, 0, 0, 0, 0, 1},
                {1, 1, 1, 1, 1, 1, 1}
        };
        System.out.println(solution1254.closedIsland(grid2));
    }
}
